# This file contains snippets that are always defined. I personally
# have snippets for signatures and often needed texts

# sligthly lower priority than everything else since specialized versions
# should overwrite. The user needs to adjust her priority in her snippets to
# ~-55 so that other filetypes will still overwrite.
priority -60

##########################
# VIM MODELINE GENERATOR #
##########################
# See advice on `:help 'tabstop'` for why these values are set. Uses second
# modeline form ('set') to work in languages with comment terminators
# (/* like C */).
snippet modeline "Vim modeline"
vim`!v ':set '. (&expandtab ? printf('et sw=%i ts=%i', &sw, &ts) : printf('noet sts=%i sw=%i ts=%i', &sts, &sw, &ts)) . (&tw ? ' tw='. &tw : '') . ':'`
endsnippet

#########
# DATES #
#########
snippet date "YYYY-MM-DD" w
`!v strftime("%Y-%m-%d")`
endsnippet

snippet ddate "年月日" w
`!v strftime("%Y年%m月%d日")`
endsnippet

snippet dmy "6 April 1988" w
`!v trim(strftime("%e %B %Y"), " ")`
endsnippet

snippet ymd "1988 April 6" w
`!v trim(strftime("%Y %B %e"), " ")`
endsnippet

snippet diso "ISO format datetime" w
`!v strftime("%Y-%m-%d %H:%M:%S%z")`
endsnippet

snippet time "hh:mm" w
`!v strftime("%H:%M")`
endsnippet

snippet datetime "YYYY-MM-DD hh:mm" w
`!v strftime("%Y-%m-%d %H:%M")`
endsnippet

##########
#  Misc  #
##########
snippet uuid "Random UUID" w
`!p if not snip.c: import uuid; snip.rv = str(uuid.uuid4())`
endsnippet

snippet sympy "sympy block " w
sympy $1 sympy$0
endsnippet

priority 10000
snippet 'sympy(.*)sympy' "sympy" wr
`!p
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
init_printing()
snip.rv = eval('latex(' + match.group(1)\
				.replace('\\', '')\
				.replace('^', '**')\
				.replace('{', '(')\
				.replace('}', ')') + ')').lstrip('- ')
`
endsnippet

# =====================
# Custom snippets start
# =====================
priority 0

snippet box "Box"
`!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'`
│ $1 │
`!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'`
$0
endsnippet

priority 10

snippet "`([^`]+)`" "calculate" ir
`!p snip.rv = eval(match.group(1))`
endsnippet

snippet lrb "()" iA
($0)
endsnippet

snippet lr' "''" iA
'$0'
endsnippet

snippet lrq "double quote" iA
"$0"
endsnippet

snippet lro "(\"\")" iA
("$0")
endsnippet

snippet lri "[\"\"]" iA
["$0"]
endsnippet

snippet lrs "[]" iA
[$0]
endsnippet

snippet lrB "{}" iA
{$0}
endsnippet

snippet ,f "=" wA
= $0
endsnippet

snippet rf "wpz reference" w
B`!v strftime("%Y%m%d")`
endsnippet
snippet em "email metadata" w
---
subject: $0
date: 
cc: anne deng <anne@wpzline.com>; Ricky <wpze@wpzline.com>; Michael <wpzm@wpzline.com>
from:
to1:
---
endsnippet

snippet inqdappol "DAP 询价起运港" w
Dear team,
Hope you are well!
We have a new $0CL inquiry and need your best rate, please kindly check the info below:

POL: <<>>
POD: <<>>
Container type: <<>>
Weight: <<>>
Incoterm: DAP

Please advise us about the rates including the ocean freight, shipping schedule and local charge at POL etc.
endsnippet

snippet inqdappod "DAP 询价目的港" w
Dear team,
Hope you are well!
We have a new $0CL inquiry and need your best rate, please kindly check the info below:

POL: <<>>
POD: please advise the nearest port from the delivery address.
Delivery address: <<>>
Incoterm: DAP
Commodity: <<>>
HS code: <<>>
Weight: <<>>
Measurement: <<>>
Container type: <<>>

Please advise us about the rates, including the trucking fee and local charge at POD etc.
endsnippet

snippet inqddppod "DDP 询价目的港" w
Dear team,
Good day!
We have a new inquiry and need your best rates

POD: Please advise the nearest port from the delivery address
Delivery address: $0
Commodity: <<>>
HS code: <<>>
Weight: <<>>
Incoterm: DDP
Value: <<>>
Cargo ready date: <<>>

Please advise the rates including the trucking fee, custom clearance fee and tax&duties fee etc.
endsnippet

snippet quofob "FOB 报价" w
Dear $0,
Good day!
Thanks for your inquiry, please check our <<>>rate for your reference.

Carrier: 
Ocean Freight: USD 
ETD: 
TT days

If you have any questions please feel free to let me know at any time.
endsnippet

snippet quopre "报价预回复" w
Dear $0,
Good day.

Thanks for your inquiry! We are working on it and will reply as soon as possible.
endsnippet

# ===================
# Custom snippets end
# ===================
